//
//  SpeacialTableViewCell.m
//  Travel
//
//  Created by 吴品泽 on 15/4/3.
//  Copyright (c) 2015年 &#21556;&#21697;&#27901;. All rights reserved.
//

#import "SpeacialTableViewCell.h"
#import <AFHTTPRequestOperation.h>
#import <UIImageView+WebCache.h>
@implementation SpeacialTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.traImageView = [[UIImageView alloc]init];
        self.titleLabel = [[UILabel alloc]init];
        self.fuLabel = [[UILabel alloc]init];
        self.backView = [[UIView alloc]init];
        [self.contentView addSubview:self.traImageView];
        [self.traImageView addSubview:self.backView];
        [self.traImageView addSubview:self.titleLabel];
        [self.traImageView addSubview:self.fuLabel];
        
    }
    
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    self.traImageView.frame = CGRectMake(10, 5, self.contentView.frame.size.width - 20, self.contentView.frame.size.height - 5);
    
    self.backView.frame = self.traImageView.bounds;
    self.backView.backgroundColor = [UIColor blackColor];
    self.backView.alpha = 0.3;
    
    self.titleLabel.frame = CGRectMake(10, self.traImageView.frame.size.height * 4.8 / 8,self.traImageView.frame.size.width - 20, self.traImageView.frame.size.height * 1.8 / 8);
    self.fuLabel.frame = CGRectMake(10, self.traImageView.frame.size.height * 6.3 / 8, self.traImageView.frame.size.width - 20, self.traImageView.frame.size.height * 1.2 / 8);
    
    self.titleLabel.textColor = [UIColor whiteColor];
    self.fuLabel.textColor = [UIColor whiteColor];
    self.titleLabel.font = [UIFont boldSystemFontOfSize:22];
    self.fuLabel.font = [UIFont systemFontOfSize:15];
    
   // self.titleLabel.backgroundColor = [UIColor redColor];
   // self.fuLabel.backgroundColor = [UIColor yellowColor];

    self.titleLabel.text = self.spe.name;
    self.fuLabel.text = self.spe.title;
    NSURL *url = [NSURL URLWithString:self.spe.image_url];
    
#warning 占位图还没添加
    [self.traImageView sd_setImageWithURL:url placeholderImage:nil];
    
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
